<template>
  <div>
    <div class="title">
      <el-button
        @click="changeDec"
        :class="{ active: isActive, notActive: !isActive }"
        >申报课题</el-button
      >
      <el-button
        @click="changeQuery"
        :class="{ active: isActive1, notActive: !isActive1 }"
        >我得课题</el-button
      >
    </div>
    <component :is="comName"></component>
  </div>
</template>

<script>
import DecTitle from "@/views/mainViews/MianHomeCom/decTitle.vue";
import QueryTitle from "@/views/mainViews/MianHomeCom/queryTitle.vue";
export default {
  name: "mainHome",
  data() {
    return {
      comName: "DecTitle",
      isActive: true,
      isActive1: false,
    };
  },
  methods: {
    changeDec() {
      this.comName = "DecTitle";
      this.isActive = true;
      this.isActive1 = false;
    },
    changeQuery() {
      this.comName = "QueryTitle";
      this.isActive1 = true;
      this.isActive = false;
    },
  },

  components: {
    DecTitle,
    QueryTitle,
  },
};
</script>

<style scoped>
.title {
  width: 250px;
  display: flex;
  height: 45px;
  background-color: #f2f2f2;
  font-size: 18px;
}
.el-button {
  border: 1px solid #e6e6e6;
  border-bottom: 0px;
  font-size: 15px;
  border-radius: 0px;
  margin-left: 0px;
  width: 200px;
}
.active {
  background: #fff;
  color: #3b85f4;
  background-color: #fff;
  border-top: 3px solid #3b85f4;
  font-weight: bolder;
}
.notActive {
  color: #3d3535;
  background-color: #f2f2f2;
  border: 0px;
}
</style>